<ui:component xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:a="https://ajax4jsf.dev.java.net/ajax"
	xmlns:rich="http://richfaces.ajax4jsf.org/rich"
	xmlns:c="http://java.sun.com/jstl/core">

<s:div styleClass="#{styleClass}" rendered="#{readOnly == null or readOnly == false}">
<script type="text/javascript">
	jQuery(function(){
  			jQuery(".auto-submit-star").rating({ 
  			  callback: function(value, link){ 
  				jQuery("input[id*='rate']").val(value);
  			  }
  			}).rating('select',#{value}).rating();
     	});
</script>

 <input type="radio" value="1" name="rating" class="auto-submit-star" style="display: none"/>
 <input type="radio" value="2" name="rating" class="auto-submit-star" style="display: none"/>
 <input type="radio" value="3" name="rating" class="auto-submit-star" style="display: none"/>
 <input type="radio" value="4" name="rating" class="auto-submit-star" style="display: none"/>
 <input type="radio" value="5" name="rating" class="auto-submit-star" style="display: none"/>
 <input type="radio" value="6" name="rating" class="auto-submit-star" style="display: none"/>
 <input type="radio" value="7" name="rating" class="auto-submit-star" style="display: none"/>
 <input type="radio" value="8" name="rating" class="auto-submit-star" style="display: none"/>
 <input type="radio" value="9" name="rating" class="auto-submit-star" style="display: none"/>
 <input type="radio" value="10" name="rating" class="auto-submit-star" style="display: none"/>

<h:inputHidden id="rate" value="#{value}" />
</s:div>
<s:div styleClass="#{styleClass}" rendered="#{readOnly == true}">
<c:forEach begin="1" end="10" varStatus="i">
	<h:graphicImage value="/resources/images/star_red_s.gif" rendered="#{i.index lt value}"/>
</c:forEach>
</s:div>

</ui:component>